import axiosInstance from "@/utils/request";

/**
 * 登录接口基础地址
 */
enum Api {
    LOGIN_BASE_URL = '/login',
    LOGIN_URL = `${LOGIN_BASE_URL}/loginSystem`,
    REGISTER_URL = `${LOGIN_BASE_URL}/registerUser`,
    UPDATE_PASSWORD = `${Api.LOGIN_BASE_URL}/updatePassword`,
}

/**
 * 登录
 * @param params 参数
 */
export const adminLogin = (params: any) => {
    return axiosInstance({
        url: Api.LOGIN_URL,
        method: 'post',
        data: params
    })
}

/**
 * 学生登录
 * @param params 参数
 */
export const studentLogin = (params: any) => {
    return axiosInstance({
        url: Api.LOGIN_URL,
        method: 'post',
        data: params
    })
}

/**
 * 注册用户
 * @param params 参数
 */
export const registerUser = (params: any) => {
    return axiosInstance({
        url: Api.REGISTER_URL,
        method: 'post',
        data: params
    })
}

/**
 * 更新密码
 * @param data 密码信息
 */
export const updatePassword = (data: any) => {
    return axiosInstance({
        url: Api.UPDATE_PASSWORD,
        method: 'post',
        data: data
    })
};
